package com.yanqu.road.server.pb;

import com.yanqu.road.entity.union.trade.UnionTradeLog;
import com.yanqu.road.pb.union.UnionTradeProto;

import java.util.ArrayList;
import java.util.List;

public class UnionTradePb {


    public static List<UnionTradeProto.TradeLogDataTempMsg> parseTradeLogDataTempMsgList(List<UnionTradeLog> logDataList) {
        List<UnionTradeProto.TradeLogDataTempMsg> builderList = new ArrayList<>();
        for (UnionTradeLog tradeLogData : logDataList) {
            UnionTradeProto.TradeLogDataTempMsg.Builder logDataMsg = UnionTradeProto.TradeLogDataTempMsg.newBuilder();
            logDataMsg.setAddTime(tradeLogData.getAddTime());
            logDataMsg.addAllParams(tradeLogData.getLogParamsList());
            logDataMsg.setEventId(tradeLogData.getEventId());
            builderList.add(logDataMsg.build());
        }
        return  builderList;
    }
}
